// sessions 页面人工坐席筛选
export const filterAgent = agnetParams => {
	let agent = [];
	agnetParams.forEach(item => {
		if (!item.isRobot) {
			if (item.assignedAgentId) {
				agent.push(item.assignedAgentId);
			}
		}
	});
	return Array.from(new Set(agent)).join(';');
};

// sessions 页面机器人坐席筛选
export const filterAiAgent = agnetParams => {
	let aiAgent = [];
	agnetParams.forEach(item => {
		if (item.isRobot) {
			if (item.assignedAgentId) {
				aiAgent.push(item.assignedAgentId);
			}
		}
	});
	return Array.from(new Set(aiAgent)).join(';');
};

// 业务场景坐席技能组坐席筛选
export const filterAgentNameByGroups = agentGroups => {
	if (agentGroups && agentGroups.length > 0) {
		// console.log('agentGroups:', agentGroups);
		let result = []
		result = agentGroups.filter(item => item.userName !== null)
		// console.warn(result);
		return result && result.length > 0 ? result.map(v => v.userName + '; ') : '-'
	}
	return '-';

};
